package com.rd.student.dashuju.wangbo.exercise02;


import java.util.Scanner;

public class Pyramid {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入金字塔层数：");
        mothod(scanner.nextInt());
    }

    public static void mothod(int number){
        for (int i = 1; i <= number; i++) {

            for (int k =1; k <= number-i; k++) {
                System.out.printf(" ");
            }

            for (int j = 1; j <=2*i-1; j++) {
                System.out.print("*");
            }

            System.out.print("\n");
        }

    }
}
